package com.bankcard.bininfo.model;

import java.util.Objects;
/**
 * Represents the information about a card issuer.
 */
public final class IssuerInfo {
    /**
     * The name of the issuer.
     */
    private final String issuerName;

    /**
     * The short name of the issuer.
     */
    private final String issuerShortName;

    /**
     * The website of the issuer.
     */
    private final String issuerWebsite;

    /**
     * The phone number of the issuer.
     */
    private final String issuerPhone;

    /**
     * The country information of the issuer.
     */
    private final CountryInfo countryInfo;

    /**
     * Constructs a new IssuerInfo instance.
     *
     * @param issuerName the name of the issuer
     * @param issuerShortName the short name of the issuer
     * @param issuerWebsite the website of the issuer
     * @param issuerPhone the phone number of the issuer
     * @param countryInfo the country information of the issuer
     */
    public IssuerInfo(String issuerName, String issuerShortName, String issuerWebsite, String issuerPhone, CountryInfo countryInfo) {
        this.issuerName = issuerName;
        this.issuerShortName = issuerShortName;
        this.issuerWebsite = issuerWebsite;
        this.issuerPhone = issuerPhone;
        this.countryInfo = countryInfo;
    }

    public String getIssuerName() {
        return issuerName;
    }

    public String getIssuerShortName() {
        return issuerShortName;
    }

    public String getIssuerWebsite() {
        return issuerWebsite;
    }

    public String getIssuerPhone() {
        return issuerPhone;
    }

    public CountryInfo getCountryInfo() {
        return countryInfo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        IssuerInfo that = (IssuerInfo) o;
        return Objects.equals(issuerName, that.issuerName) &&
                Objects.equals(countryInfo, that.countryInfo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(issuerName, countryInfo);
    }

    @Override
    public String toString() {
        return "IssuerInfo{" +
                "issuerName='" + issuerName + '\'' +
                ", issuerShortName='" + issuerShortName + '\'' +
                ", issuerWebsite='" + issuerWebsite + '\'' +
                ", issuerPhone='" + issuerPhone + '\'' +
                ", countryInfo=" + countryInfo +
                '}';
    }
}